<template>
  <!--  中间统计部分 -->
  <div class="count">
    <div class="list">
      <div class="item item_left_year">
        <div class="label">
          <p>年工单量</p>
          <p class="value">{{ workOrderCount.yearNum }}</p>
        </div>
        <img
          :src="require('/public/img/workOrder/img1.webp')"
          alt=""
          class="icon"
        />
      </div>
      <div class="item item_left_month">
        <div class="label">
          <p>月工单量</p>
          <p class="value">{{ workOrderCount.monthNum }}</p>
        </div>
        <img
          :src="require('/public/img/workOrder/img1.webp')"
          alt=""
          class="icon"
        />
      </div>
      <div class="item item_left_day">
        <div class="label">
          <p>日工单量</p>
          <p class="value">{{ workOrderCount.dayNum }}</p>
        </div>
        <img
          :src="require('/public/img/workOrder/img1.webp')"
          alt=""
          class="icon"
        />
      </div>
      <div class="item item_right item_right_year">
        <div class="label">
          <p>年送货量</p>
          <p class="value">{{ deliverCount.yearNum }}</p>
        </div>
        <img
          :src="require('/public/img/workOrder/img2.webp')"
          alt=""
          class="icon"
        />
      </div>
      <div class="item item_right item_right_month">
        <div class="label">
          <p>月送货量</p>
          <p class="value">{{ deliverCount.monthNum }}</p>
        </div>
        <img
          :src="require('/public/img/workOrder/img2.webp')"
          alt=""
          class="icon"
        />
      </div>
      <div class="item item_right item_right_day">
        <div class="label">
          <p>日送货量</p>
          <p class="value">{{ deliverCount.dayNum }}</p>
        </div>
        <img
          :src="require('/public/img/workOrder/img2.webp')"
          alt=""
          class="icon"
        />
      </div>
    </div>
    <img
      :src="require('/public/img/workOrder/bg_center.webp')"
      alt=""
      class="bg_center"
    />
    <img
      :src="require('/public/img/workOrder/center_left.webp')"
      alt=""
      class="bg_left"
    />
    <img
      :src="require('/public/img/workOrder/center_right.webp')"
      alt=""
      class="bg_right"
    />
  </div>
</template>
<script>
export default {
  name: 'count',
  data () {
    return {
      deliverCount: {},
      workOrderCount: {}
    }
  },
  mounted () {
    this.getData()
  },
  methods: {
    async getData () {
      let res1 = await this.$API.produce.workOrder.getDeliverCount.get()
      let res2 = await this.$API.produce.workOrder.getWorkOrderCount.get()
      this.deliverCount = res1.data
      this.workOrderCount = res2.data

    }
  }
}
</script>
<style lang="scss" scoped>
.count {
  position: relative;
  width: 50%;
  margin: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.list {
  position: relative;
  width: 750px;
  height: 550px;
  // margin: 80px auto;
  box-sizing: border-box;
  z-index: 999;
  .item {
    position: absolute;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
  .icon {
    width: 126px;
    height: 100px;
  }
  .item_left_year {
    top: 50px;
    left: 0;
  }
  .item_left_month {
    bottom: 120px;
    left: 0;
  }
  .item_left_day {
    bottom: -60px;
    left: 170px;
  }
  .item_right {
    .value {
      color: #50ff57;
    }
  }
  .item_right_year {
    top: 50px;
    right: 0;
  }
  .item_right_month {
    bottom: 120px;
    right: 0;
  }
  .item_right_day {
    bottom: -60px;
    right: 170px;
  }
  .label {
    display: flex;
    align-items: center;
  }
  .value {
    margin-left: 5px;
    font-size: 18px;
    font-weight: 600;
    color: #fcff50;
  }
  .icon {
    width: 126px;
  }
}

.bg_center {
  position: absolute;
  width: 620px;
  height: 500px;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  box-sizing: border-box;
  z-index: 1;
}
.bg_left {
  position: absolute;
  width: 144px;
  top: 50px;
  left: 0;
  z-index: 1;
}
.bg_right {
  position: absolute;
  width: 144px;
  top: 50px;
  right: 0;
  z-index: 1;
}
</style>